package com.ischoolbar.programmer.service.admin.impl;

import com.ischoolbar.programmer.dao.admin.AuthorityDao;
import com.ischoolbar.programmer.entity.admin.Authority;
import com.ischoolbar.programmer.service.admin.IAuthorityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AuthorityServiceImpl implements IAuthorityService {

    @Autowired
    AuthorityDao authorityDao;

    @Override
    public void add(Authority authority) {
        authorityDao.add(authority);
    }

    @Override
    public void delete(Integer id) {
        authorityDao.delete(id);
    }

    @Override
    public List<Authority> findAllAuthority() {
        return authorityDao.findAllAuthority();
    }

    @Override
    public List<Authority> findAuthorityByRoleId(Integer roleId) {
        return authorityDao.findAuthorityByRoleId(roleId);
    }
}
